import Vue from 'vue'
import BootstrapVue from 'bootstrap-vue'
import App from './App.vue'
import router from './router'
import './plugins/table.js'
import './plugins/jtopo-0.4.8-min'
import echarts from 'echarts'
import TreeTable from 'vue-table-with-tree-grid' // 导入第三方插件

import axios from "axios"
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import components from "./plugins/components"
Object.keys(components).forEach(key => {
  const name = key.replace(/(\w)/, (v) => v.toUpperCase())
  Vue.component("v"+name, components[key])
})
import "../src/assets/icon/iconfont.css"

// import GlobalComponents from "./globalComponents"
// import GlobalDirectives from "./globalDirectives"
// import Notifications from "./components/NotificationPlugin"
import MaterialDashboard from "./material-dashboard"

import Chartist from "chartist"

Vue.prototype.$Chartist = Chartist;
Vue.component('tree-table', TreeTable) // 手动注册
// Vue.use(VueRouter);
Vue.use(MaterialDashboard);
// Vue.use(GlobalComponents);
// Vue.use(GlobalDirectives);
// Vue.use(Notifications);

// 全局修改默认配置，点击空白处不能关闭弹窗
ElementUI.Dialog.props.closeOnClickModal.default = false

Vue.use(ElementUI)
Vue.use(BootstrapVue)
Vue.config.productionTip = false
// axios.defaults.baseURL = "http://192.168.1.41:8081/ZabbixPlatform";
// axios.defaults.baseURL = "http://192.168.1.204:8081/ZabbixPlatform";
// axios.defaults.baseURL = "http://9.17.4.102:8081/ZabbixPlatform";
// axios.defaults.baseURL = "http://9.17.0.223:8081/ZabbixPlatform";
axios.defaults.baseURL = "http://192.168.1.191:8081/ZabbixPlatform";


Vue.prototype.$echarts = echarts
// 没有此设置，后端就无法将数据保存再cookie中
axios.defaults.withCredentials = true


new Vue({

  router,
  render: h => h(App),

}).$mount('#app')
